package com.example.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @ClassName DemoController
 * @Description TODO
 * @Author: XMK
 * @Date: 2021/10/18 14:36
 * @Version: 1.0
 */
@RestController
@RequestMapping("/demo")
public class DemoController {
    @Autowired
    private RestTemplate restTemplate;

    @GetMapping("/hello")
    public String hello() {

        String aaa = restTemplate.getForObject("http://eureka-provider/demo/hello", String.class, "aaa");

        return aaa;
    }
}
